$(function () {

    $(".fq-ScrollDiv").slimscroll({
        height: "470px",
        allowPageScroll:true,
        alwaysVisible: true,
        size: "5px"
    });
    $("[cube-type=select]").select();

    $(".fq-tab-tit li").click(function(){
        $(this).addClass("active").siblings().removeClass("active");
    });

    //Initialize Select2 Elements
    $(".select2").select2();

    //Datemask dd/mm/yyyy
    $("#datemask").inputmask("dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"});
    //Datemask2 mm/dd/yyyy
    $("#datemask2").inputmask("mm/dd/yyyy", {"placeholder": "mm/dd/yyyy"});
    //Money Euro
    $("[data-mask]").inputmask();

    //Date range picker
    $('#reservation').daterangepicker();

    //Date range picker
    $('#reservation2').daterangepicker();
    //Date range picker with time picker
    $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'});
    //Date range as a button
    $('#daterange-btn').daterangepicker(
        {
            ranges: {
                'Today': [moment(), moment()],
                'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                'Last 7 Days': [moment().subtract(6, 'days'), moment()],
                'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                'This Month': [moment().startOf('month'), moment().endOf('month')],
                'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
            },
            startDate: moment().subtract(29, 'days'),
            endDate: moment()
        },
        function (start, end) {
            $('#daterange-btn span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
        }
    );

    //Date picker
    $('#datepicker').datepicker({
        autoclose: true
    });

    //iCheck for checkbox and radio inputs
    $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
        checkboxClass: 'icheckbox_minimal-blue',
        radioClass: 'iradio_minimal-blue'
    });
    //Red color scheme for iCheck
    $('input[type="checkbox"].minimal-red, input[type="radio"].minimal-red').iCheck({
        checkboxClass: 'icheckbox_minimal-red',
        radioClass: 'iradio_minimal-red'
    });
    //Flat red color scheme for iCheck
    $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
        checkboxClass: 'icheckbox_flat-green',
        radioClass: 'iradio_flat-green'
    });

    //Colorpicker
    $(".my-colorpicker1").colorpicker();
    //color picker with addon
    $(".my-colorpicker2").colorpicker();

    //Timepicker
    $(".timepicker").timepicker({
        showInputs: false
    });
    initBankCode();
});

var bankCoe= new Object();

function initBankCode(){
    bankCoe["ICBC"]= "中国工商银行";
    bankCoe["CCB"]= "中国建设银行";
    bankCoe["BOC"]= "中国银行";
    bankCoe["ABC"]= "中国农业银行";
    bankCoe["BCM"]= "交通银行";
    bankCoe["PSBC"]= "邮储银行";
    bankCoe["CMB"]= "招商银行";
    bankCoe["CITIC"]= "中信银行";
    bankCoe["SPDB"]= "上海浦东发展银行";
    bankCoe["CIB"]= "兴业银行";
    bankCoe["CMBC"]= "中国民生银行";
    bankCoe["CEB"]= "中国光大银行";
    bankCoe["PAB"]= "平安银行";
    bankCoe["HXB"]= "华夏银行";
    bankCoe["BOB"]= "北京银行";
    bankCoe["CGB"]= "广发银行";
    bankCoe["BOS"]= "上海银行";
    bankCoe["JSB"]= "江苏银行";
    bankCoe["EGB"]= "恒丰银行";
    bankCoe["BJRCB"]= "北京农村商业银行";
    bankCoe["CQRCB"]= "重庆农村商业银行";
    bankCoe["CBHB"]= "渤海银行";
    bankCoe["SRCB"]= "上海农村商业银行";
    bankCoe["CZB"]= "浙商银行";
    bankCoe["NJCB"]= "南京银行";
    bankCoe["GRCB"]= "广州农村商业银行";
    bankCoe["HSBC"]= "汇丰银行（中国）";
    bankCoe["NBCB"]= "宁波银行";
    bankCoe["HSB"]= "徽商银行";
    bankCoe["HZB"]= "杭州银行";
    bankCoe["TJCB"]= "天津银行";
    bankCoe["BOSJ"]= "盛京银行";
    bankCoe["GZCB"]= "广州银行";
    bankCoe["BOHRB"]= "哈尔滨银行";
    bankCoe["BODL"]= "大连银行";
    bankCoe["CDRCB"]= "成都农村商业银行";
    bankCoe["BOJL"]= "吉林银行";
    bankCoe["JNRCB"]= "江南农村商业银行";
    bankCoe["BSB"]= "包商银行";
    bankCoe["BOCD"]= "成都银行";
    bankCoe["BEAI"]= "东亚银行（中国）";
    bankCoe["SCBL"]= "渣打银行（中国）";
    bankCoe["BOLJ"]= "龙江银行";
    bankCoe["TJRCB"]= "天津农村商业银行";
    bankCoe["DRCB"]= "东莞农村商业银行";
    bankCoe["HKB"]= "汉口银行";
    bankCoe["SDEB"]= "佛山顺德农村商业银行";
    bankCoe["BOKL"]= "昆仑银行";
    bankCoe["CITIB"]= "花旗银行（中国）";
    bankCoe["CQCB"]= "重庆银行";
    bankCoe["DGCB"]= "东莞银行";
    bankCoe["JHCCB"]= "金华银行";
    bankCoe["FDB"]= "富滇银行";
    bankCoe["ZJTLCB"]= "浙江泰隆银行";
    bankCoe["QDCCB"]= "青岛银行";
    bankCoe["CHAB"]= "长安银行";
    bankCoe["TAB"]= "泰安银行";
    bankCoe["RZB"]= "日照银行";
    bankCoe["WFCCB"]= "潍坊银行";
    bankCoe["LSB"]= "临商银行";
    bankCoe["LWB"]= "莱商银行";
    bankCoe["DZB"]= "德州银行";
    bankCoe["QSB"]= "齐商银行";
    bankCoe["CJCCB"]= "长江银行";
    bankCoe["BOLY"]= "洛阳银行";
    bankCoe["GDNYCB"]= "广东南粤银行";
    bankCoe["JZCB"]= "晋中市商业银行";
    bankCoe["BOIMC"]= "内蒙古银行";
    bankCoe["ORDOS"]= "鄂尔多斯银行";
    bankCoe["BONX"]= "宁夏银行";
    bankCoe["BOXM"]= "厦门银行";
    bankCoe["BOFX"]= "阜新银行";
    bankCoe["YNNX"]= "云南农信";
    bankCoe["WZCB"]= "温州银行";
    bankCoe["CZCB"]= "浙江稠州商业银行";
    bankCoe["QLB"]= "齐鲁银行";
    bankCoe["GSNX"]="甘肃省农村信用社联合社";

    bankCoe["NMGNX"]="内蒙古农村信用社";
    bankCoe["SHXNX"]="陕西省农村信用社联合社";
    bankCoe["GDNYB"]="广东南粤银行";
    bankCoe["GSNX"]="甘肃省农村信用社联合社";
    bankCoe["XJNX"]="新疆省农村信用社联合社";
    bankCoe["ZJNX"]="浙江省农村信用社联合社";
}